<div class="nav-wrapper">
    <ul id="nav" class="nav" data-slim-scroll data-collapse-nav data-highlight-active>
        <?php foreach($purview as $v): ?>
            <li><a href="<?=$v['url']?>"><i class="<?=$v['icon']?>"></i><span><?=$v['title']?></span></a>
                <?php if(isset($v['submenus']) && count($v['submenus']) > 0): ?>
                    <ul>
                        <?php foreach($v['submenus'] as $menu): ?>
                            <li><a href="<?=$menu['url']?>"><i class="<?=$menu['icon']?>"></i><span><?=$menu['title']?></span></a></li>
                        <?php endforeach; ?>
                    </ul>
                <?php endif; ?>
            </li>
        <?php endforeach; ?>
    </ul>
</div>

